import mongoose  from 'mongoose'
import BaseModel from "./base_model"

let Schema    = mongoose.Schema
let ObjectId  = Schema.ObjectId

var StaticSchema = new Schema({
  appId:        { type: String, required: true },
  name:         { type: String, required: true },
  title:        { type: String, required: true },
  content:      { type: String, required: true },
  isHtml:       { type: Boolean, default: false },
  isContrast:   { type: Boolean, default: false },
  create_at:    { type: Date, default: Date.now },
});
StaticSchema.plugin(BaseModel);
StaticSchema.index({create_at: -1});

mongoose.model('Static', StaticSchema);